<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php /* @var $block \Magento\Backend\Block\Template */ ?>
<div class="field field-store-switcher">
    <label class="label" for="store_switcher"><?php /* @escapeNotVerified */ echo __('Current Configuration Scope:') ?></label>
    <div class="control">
        <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')">
        <?php foreach ($block->getStoreSelectOptions() as $_value => $_option): ?>
        <?php if (isset($_option['is_group'])): ?>
            <?php if ($_option['is_close']): ?>
                </optgroup>
            <?php else: ?>
                <optgroup label="<?php echo $block->escapeHtml($_option['label']) ?>" style="<?php /* @escapeNotVerified */ echo $_option['style'] ?>">
            <?php endif; ?>
            <?php continue ?>
        <?php endif; ?>
          <option value="<?php echo $block->escapeHtml($_value) ?>" url="<?php /* @escapeNotVerified */ echo $_option['url'] ?>" <?php echo $_option['selected'] ? 'selected="selected"' : '' ?> style="<?php /* @escapeNotVerified */ echo $_option['style'] ?>">
              <?php echo $block->escapeHtml($_option['label']) ?>
          </option>
        <?php endforeach ?>
        </select>
    </div>
    <?php echo $block->getHintHtml() ?>
    <?php if ($block->getAuthorization()->isAllowed('Magento_Backend::store')): ?>
        <div class="actions">
            <a href="<?php /* @escapeNotVerified */ echo $block->getUrl('*/system_store') ?>"><?php /* @escapeNotVerified */ echo __('Stores') ?></a>
        </div>
    <?php endif; ?>
</div>
